home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_200
/
255_01
/
ega.doc
< prev
next >
Wrap
Text File
|
1988-03-28
|
49KB
|
1,551 lines
DATE: 02/25/86
SYSTEM: KC-TPEGA
Graphics for the IBM's Enhance Graphic Adapter (EGA)
Version 02/25/86
for Microsoft C 3.00+
and
Turbo Pascal 3.01A+
DATE: 02/03/86
SYSTEM: KC-TPEGA
IMPORTANT NOTICE
The Enhanced Graphic Adapter (EGA) graphic routines for Microsoft
3.0 and Turbo Pascal 3.01A was written and is maintained by:
Kent Cedola
2015 Meadow Lake Court
Norfolk, Virginia 23518
1-(804)-857-0613
Users of this software are encouraged to copy and distribute the
graphics library and demonstrations programs which are a part of
this package for non-commericial purposes.
No fee or other charges may be made in the distribution of these
programs without the written permission from Kent Cedola.
Any program written with this graphic library may be sold, as
long as the source code for the graphic library in not included.
If you wish to include the graphic library with the product,
please contact me for more information and written permission.
The date of release will be used in instead of a version. When
requesting information, please included the date (version) of the
copy that you have and the amount of EGA memory. Write the above
for the current release of the graphic library.
If you are satified with the EGA support for Turbo Pascal you are
asked to send a donation of $20.00 dollars. All registered users
will be informed of any major improvements and/or programs
developments.
FREE COPY OF TPEGA
If you send a diskette with a SASE, I will send you the current
copy of the library and programs for FREE! (360k or 1.2meg disk)
DATE: 02/03/86
SYSTEM: KC-TPEGA
GENERAL
This graphic software was written to provide the general public
a means for writing graphic program for the EGA without any run-
time fee! The software is also design to give the programmer
the most flexibility, so most graphic routines can be changed or
deleted (saving space) from the final product.
Those with the standard EGA (only 64k of memory) may have some
problems with some of the graphic primitives as I have a 128k+
EGA. I highly recommend adding extra memory to your EGA if
you plan to do alot of graphic programming.
DATE: 02/03/86
SYSTEM: KC-TPEGA
SPECIAL NOTICE
While trying to get as many graphic routines as possible in this
release I had to cut corners on the GPSHADE, GPFILL and GPFLOOD
graphic primitives. The GPFILL should be used for simple objects
to be filled in and GPFLOOD for complex objects. Currently, GPFILL
calls GPFLOOD to do the fill, this will change in the future as I
will write a version of GPFILL that will execute two or three times
faster than GPFLOOD (GPFILL = Simple objects only). GPSHADING has
a restriction for dimensions of 1,2,4 or 8 or both width and height.
Other dimensions can be used, but funny fills may happen (will be
fixed later). The GPFLOOD routine is fast, and will fill in any
area no matter how complex (more complex more stack space), but I
will re-write it for higher speeds.
Both the GPBOX and GPBALL primitives only do solid colors and not
shades. Both use special EGA full byte fill modes and are fast.
BPBOX and GPBALL do NOT set the clipping flag. (Later)
These primitives do work, but they can be better. I will improve
the flexibility and speed of these routines in the future.
The following routines miss this release (are in the documentation)
will be included in a future release.
GPSCROLL
GPPOLY
DATE: 02/03/86
SYSTEM: KC-TPEGA
List of Graphic Functions
Graphics Routines Description
---------------------------- ---------------------------------
GPPARMS; Setup graphic adapter parameters
GPINIT; Initialize graphic display
GPTERM; Terminate graphic display
GPCOLOR(b); Set current color
GPMERGE(b); Set current merge mode
GPSTYLE(array); Set pattern for drawing lines
GPSHADE(array); Set pattern for shading areas
GPRDCLR; Return the current color
GPPAL(p,v); Set a palette register
GPCPAL(p,v); Set a palette register using RGB
GPLDPAL(array); Load all palette registers
GPRDPAL(p); Read current palette setting
GPPLOT(X,Y); Plot a point at X,Y (sets new CP)
GPRDDOT(X,Y) Read pixel at coordinates (X,Y)
GPMOVE(X,Y); Set current graphic position (CP)
GPLINE(X,Y); Draw a line from (CP) to X,Y
GPPOLY(array,N); Draw a N number of lines
GPRECT(X,Y); Draw a rectangle between CP and (X,Y)
GPCIR(R); Draw a circle at CP with R radius
GPWTROW(Array,N); Write a row of pixels
GPWTCOL(Array,N); Write a column of pixels
GPRDROW(Array,N); Read a row of pixels
GPRDCOL(Array,N); Read a column of pixels
GPBOX(X,Y); Draws a solid box with color/shading
GPBAL(R); Draws a solid circle with color/shading
GPSCROLL(Dir,I,N); Scroll current viewport
GPVIEWPORT(X1,Y1,X2,Y2); Set current viewport
GPWINDOW(X1,Y1,X2,Y2); Set current window
GPCLIP1(X,Y); Clip point in current window
GPCLIP2(X1,Y1,X2,Y2); Clip line in current window
GPSCALE(X,Y); Scale from world to device
GPFILL(Border); Simple object fill, color/shading
GPFLOOD(Border); Complex object fill, color/shading
DATE: 02/03/86
SYSTEM: KC-TPEGA
List of Global Variables
Global Variable Description
---------------------------- ---------------------------------
GDTYPE: Integer; 3 = CG, 4 = Mono, 5 = Color
GDOTHER: Internal Use Only
GDMEMORY: Integer; Amount of memory, 64 -> 256
GDMAXCOL: Integer; Maximum column (639 for EGA)
GDMAXROW: Integer; Maximum row (199/349 fo